package Java练习.字符串练习;

import jdk.jshell.Snippet;

import java.util.Scanner;

public class 字符串反转 {
    public static void main(String[] args) {
        //键盘录入
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入你要进行反转的字符串:");
        String str = sc.next();
        //字符串反转
        ch(str);

    }
    public static void ch(String str){
        for (int i = 0; i < str.length(); i++) {
            char n=str.charAt(str.length()-i-1);
            System.out.print(n);
        }
    }
}
